#ifndef EST_FLAGS_HPP
#define EST_FLAGS_HPP

#include <uORB/topics/estimator_status_flags.h>
class MavlinkStreamEstFlags : public MavlinkStream
{
public:
	static MavlinkStream *new_instance(Mavlink *mavlink) { return new MavlinkStreamEstFlags(mavlink); }

	static constexpr const char *get_name_static() { return "EST_FLAGS"; }
	static constexpr uint16_t get_id_static() { return MAVLINK_MSG_ID_EST_FLAGS; }

	const char *get_name() const override { return get_name_static(); }
	uint16_t get_id() override { return get_id_static(); }

	unsigned get_size() override
	{
		return est_flags_sub.advertised() ? MAVLINK_MSG_ID_EST_FLAGS_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES : 0;
	}

private:
	explicit MavlinkStreamEstFlags(Mavlink *mavlink) : MavlinkStream(mavlink) {}

	uORB::Subscription est_flags_sub{ORB_ID(estimator_status_flags)};

	bool send() override
	{
		estimator_status_flags_s estimator_status_flags;

		if (est_flags_sub.update(&estimator_status_flags)) {
			mavlink_est_flags_t msg{};
msg.cs_gps=estimator_status_flags.cs_gps;
msg.cs_opt_flow=estimator_status_flags.cs_opt_flow;
msg.cs_mag_hdg=estimator_status_flags.cs_mag_hdg;	
msg.cs_baro_hgt=estimator_status_flags.cs_baro_hgt;
msg.cs_rng_hgt=estimator_status_flags.cs_rng_hgt;
msg.cs_gps_hgt=estimator_status_flags.cs_gps_hgt;
msg.cs_ev_pos=estimator_status_flags.cs_ev_pos;
msg.cs_ev_yaw=estimator_status_flags.cs_ev_yaw;
msg.cs_ev_hgt=estimator_status_flags.cs_ev_hgt;
msg.cs_gps_yaw=estimator_status_flags.cs_gps_yaw;
msg.cs_ev_vel=estimator_status_flags.cs_ev_vel;	
			mavlink_msg_est_flags_send_struct(_mavlink->get_channel(), &msg);
			return true;
		}

		return false;
	}
};

#endif // MOUNT_ORIENTATION

